import Vue from 'vue'
import VueRouter from 'vue-router'

import Mint from 'mint-ui'
import 'mint-ui/lib/style.css'
Vue.use(Mint)

Vue.use(VueRouter);
//以下代码解决路由地址重复点击的报错问题
const originalPush = VueRouter.prototype.push
VueRouter.prototype.push = function push(location) {
  return originalPush.call(this, location).catch(err => err)
}

const routes = [
  {
    path: '/',
    name: 'Start',
    component: () => import("@/views/start/Start"),
  },
  {
    path: '/home',
    name: 'Home',
    component: () => import("@/views/home/Home"),
    meta: {
      title: '首页',//头部标题
      showTabbar: true// true显示，false隐藏
    }
  },
  {
    path: '/info',
    name: 'Info',
    component: () => import("@/views/info/Info"),
    meta: {
      title: '消息',
      showTabbar: true
    }
  },
  {
    path: '/info/infoFlock',
    name: 'InfoFlock',
    component: () => import("@/views/info/InfoFlock"),
    meta: {
      title: '群聊',
    }
  },
  {
    path: '/info/infoFlock/flockDetails/:id',
    name: 'flockDetails',
    component: () => import("@/views/info/FlockDetails"),
    meta: {
      title: '群聊',
    }
  },
  {
    path: '/login',
    name: 'Login',
    component: () => import("@/views/login/Login"),
    meta: {
      title: '登录'
    }
  },
  {
    path: '/regist',
    name: 'Regist',
    component: () => import("@/views/login/Regist"),
    meta: {
      title: '注册'
    }
  },
  {
    path: '/forgot',
    name: 'Forgot',
    component: () => import("@/views/login/Forgot"),
    meta: {
      title: '找回密码'
    }
  },
  {
    path: '/third/:id',
    name: 'Third',
    component: () => import("@/views/login/Third"),
    meta: {
      title: 'QQ'
    }
  },
  {
    path: '/bind',
    name: 'Bind',
    component: () => import("@/views/login/Bind"),
    meta: {
      title: '手机认证'
    }
  },
  {
    path: '/registInfo',
    name: 'RegistInfo',
    component: () => import("@/views/login/RegistInfo"),
    meta: {
      title: '基本信息'
    }
  },
  {
    path: '/info/infoFlock/flockSet',
    name: 'FlockSet',
    component: () => import("@/views/info/FlockSet"),
    meta: {
      title: '群聊设置'
    }
  },
  //j2推荐部分
 
  {
    path: '/recommend',
    component: () => import('@/views/Recommend/recommend.vue'),
    meta: {
      showTabbar: true, 
    },
  },
  {
    path: '/recommend/userInfo',
    component: () => import('@/views/Recommend/userInfo.vue')
  },
  {
    path: '/userInfo/userInfoDetail',
    component: () => import('@/views/Recommend/userInfoDetail.vue')
  },
  {
    path: '/recommend/userData',
    component: () => import('@/views/Recommend/userData.vue')
  },
  //j4发现部分
  {
    path: '/Find',
    component: () => import('@/views/Find/Find.vue'),
    meta: {
      showTabbar: true
    },
  },
  {
    path: '/Latest',
    component: () => import('@/views/Find/Latest.vue'),
  },
  {
    path: '/Find/LoveDetail',
    component: () => import('@/views/Find/LoveDetail.vue'),
  },
  {
    path: '/LoveDetail/ForumDetail',
    component: () => import('@/views/Find/ForumDetail.vue'),
  },
  {
    path: '/Latest/LatestDetail',
    component: () => import('@/views/Find/LatestDetail.vue'),
  },


  // j5我的部分
  {
    path: '/mine',
    component: () => import('../views/Mine/j5/mine.vue'),
    meta: {
      showTabbar: true
    }
  },
  {
    path: '/shez',
    component: () => import('../views/Mine/j5-1/shez.vue')
  },
  {
    path: '/zil',
    component: () => import('../views/Mine/j5-2/zil.vue')
  },
  {
    path: '/news',
    component: () => import('../views/Mine/j5-3/news.vue')
  },
  {
    path: '/member',
    component: () => import('../views/Mine/j5-4/member.vue')
  },
  {
    path: '/member1',
    component: () => import('../views/Mine/j5-4/member1.vue')
  },
  {
    path: '/member2',
    component: () => import('../views/Mine/j5-4/member2.vue')
  },
  {
    path: '/member3',
    component: () => import('../views/Mine/j5-4/member3.vue')
  },
  {
    path: '/fashion',
    component: () => import('../views/Mine/j5-5/fashion.vue')
  },
  {
    path: '/J5-5-1',
    component: () => import('../views/Mine/j5-5/J5-5-1.vue')
  },
  {
    path: '/J5-6',
    component: () => import('../views/Mine/j5-6/J5-6.vue')
  },
  {
    path: '/friends',
    component: () => import('../views/Mine/j5-7/friends.vue')
  },
  {
    path: '/J5-8',
    component: () => import('../views/Mine/j5-8/J5-8.vue')
  }
]


const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
